package com.orange.core.mapper.shop;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orange.core.pojo.entity.shop.Shop;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author lwm
* @description 针对表【shop(店铺表)】的数据库操作Mapper
* @createDate 2025-05-24 20:33:59
* @Entity generator.domain.Shop
*/
public interface ShopMapper extends BaseMapper<Shop> {

    @Select("SELECT s.* FROM shop s " +
            "JOIN floor f ON s.floor_id = f.id " +
            "JOIN mall_area a ON f.area_id = a.id " +
            "WHERE s.status = 1 " +
            "AND (#{categoryId} IS NULL OR s.category_id = #{categoryId}) " +
            "AND (#{areaId} IS NULL OR a.id = #{areaId}) " +
            "AND (#{floorId} IS NULL OR f.id = #{floorId})")
    List<Shop> findShopsByCondition(@Param("categoryId") Integer categoryId,
                                    @Param("areaId") String areaId,
                                    @Param("floorId") String floorId);
}




